home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / macformat-005.iso / Shareware City / Developers / Incognito 1.2ß2 src Folder / Incognito ƒ / cdev / CControlPanel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-08  |  1.3 KB  |  75 lines  |  [TEXT/MPS ]

  1. #ifndef __CCONTROLPANEL__
  2. #define __CCONTROLPANEL__
  3. #pragma once
  4.  
  5. #ifndef __CLISTMANAGER__
  6. #include "CListManager.h"
  7. #endif
  8.  
  9. #ifndef __EVENTS__
  10. #include <Events.h>
  11. #endif
  12.  
  13. #ifndef __DIALOGS__
  14. #include <Dialogs.h>
  15. #endif
  16.  
  17. class CControlPanel : public SingleObject
  18. {
  19.     public:
  20.     
  21.                 CControlPanel(short numItems);
  22.                 ~CControlPanel();
  23.         
  24.         void    SetArguments(short item, EventRecord *theEvent, DialogPtr theDialog);
  25.         long    DispatchMessage(short theMessage);
  26.  
  27.     protected:
  28.         enum        // dialog items
  29.         {
  30.             kAddButton = 1,
  31.             kListBox,
  32.             kRemoveButton,
  33.             kGestaltSelector = 5,
  34.             kEditButton,
  35.             kPrefsName = 0,
  36.             kChooseDialog = -4033
  37.         };
  38.         
  39.         long    DoInit();
  40.         long    DoHit();
  41.         long    DoClose();
  42.         long    DoUpdate();
  43.         long    DoActivate();
  44.         long    DoDeactivate();
  45.         long    DoKey();
  46.         
  47.         long    ReadPreferencesIntoList();
  48.         void    InsertItems();
  49.         
  50.         void    SavePreferences();
  51.         void    RemovePreferences();
  52.         
  53.         CListManager    *fTheList;        // the list of items 2 b masked
  54.         EventRecord        *fTheEvent;
  55.         DialogPtr        fTheDialog;
  56.         OSType            fGestaltSelector;    // the gestalt selector
  57.         short            fItemHit;
  58.         short            fNumItems;
  59. private:
  60.         enum
  61.         {
  62.             kOkButton = 1,
  63.             kCancelButton,
  64.             kLookupButton = 8,
  65.             kLookupAsyncButton,
  66.             kRegisterButton,
  67.             kRegisterAsyncButton,
  68.             kUnregisterButton,
  69.             kUnregisterAsyncButton,
  70.             kItemPrefDialog = 128
  71.         };
  72.         long DoItemPrefs(long theValue);
  73. };
  74.  
  75. #endif